USE DB_TCC
GO
IF EXISTS(SELECT 1 FROM SYSOBJECTS WHERE NAME LIKE 'P_PERGUNTA_AREA_LISTAR')
	DROP PROCEDURE P_PERGUNTA_AREA_LISTAR
GO
CREATE PROCEDURE P_PERGUNTA_AREA_LISTAR(
	@IDAREA INTEGER)
AS BEGIN
	SELECT
		IDPERGUNTA,
		DESCPERGUNTA
	FROM
		PERGUNTA
	WHERE
		IDAREA = @IDAREA
		OR IDAREA IS NULL
END